# CMSIS Build CMakeLists generated on 2024-03-09T11:10:09

cmake_minimum_required(VERSION 3.22)

# Target options

set(TARGET joytick)
set(CPU Cortex-M3)
set(PRJ_DIR "f:/cube mx project/JOYTICK/MDK-ARM")
set(OUT_DIR "F:/cube mx project/JOYTICK/MDK-ARM/out/joytick/joytick")
set(INT_DIR "F:/cube mx project/JOYTICK/MDK-ARM/tmp/joytick/joytick")
set(FPU NO_FPU)
set(BYTE_ORDER Little-endian)
set(OPTIMIZE none)
set(DEBUG on)
set(CC_FLAGS_GLOBAL "-std=c99 -fno-rtti -funsigned-char -fshort-enums -fshort-wchar -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality")
set(CXX_FLAGS_GLOBAL "-xc++ -std=c++03 -fno-rtti -funsigned-char -fshort-enums -fshort-wchar -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality")
set(LD_FLAGS_GLOBAL "--library_type=microlib --map --load_addr_map_info --xref --callgraph --symbols --info sizes --info totals --info unused --info veneers --strict --summary_stderr --info summarysizes")
set(LD_SCRIPT "f:/cube mx project/JOYTICK/MDK-ARM/joytick_joytick.sct")

set(DEFINES
  STM32F10X_MD
  _RTE_
  USE_HAL_DRIVER
  STM32F103xB
  __MICROLIB
)

set(INC_PATHS
  "f:/cube mx project/JOYTICK/Core/Inc"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Inc"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"
  "f:/cube mx project/JOYTICK/Drivers/CMSIS/Device/ST/STM32F1xx/Include"
  "f:/cube mx project/JOYTICK/Drivers/CMSIS/Include"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_mcu/inc"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_periph/inc"
  "f:/cube mx project/JOYTICK/MDK-ARM/Hardware/Inc"
  "f:/cube mx project/JOYTICK/MDK-ARM/RTE/_joytick"
  "C:/Users/LENOVO/AppData/Local/arm/packs/ARM/CMSIS/5.9.0/CMSIS/Core/Include"
  "C:/Users/LENOVO/AppData/Local/arm/packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include"
)

set(AS_ARM_SRC_FILES
  "f:/cube mx project/JOYTICK/MDK-ARM/startup_stm32f103xb.s"
)

set(CC_SRC_FILES
  "f:/cube mx project/JOYTICK/Core/Src/adc.c"
  "f:/cube mx project/JOYTICK/Core/Src/dma.c"
  "f:/cube mx project/JOYTICK/Core/Src/gpio.c"
  "f:/cube mx project/JOYTICK/Core/Src/main.c"
  "f:/cube mx project/JOYTICK/Core/Src/spi.c"
  "f:/cube mx project/JOYTICK/Core/Src/stm32f1xx_hal_msp.c"
  "f:/cube mx project/JOYTICK/Core/Src/stm32f1xx_it.c"
  "f:/cube mx project/JOYTICK/Core/Src/system_stm32f1xx.c"
  "f:/cube mx project/JOYTICK/Core/Src/tim.c"
  "f:/cube mx project/JOYTICK/Core/Src/usart.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c"
  "f:/cube mx project/JOYTICK/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/Hardware/Src/Bai_Bi_SW.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/Hardware/Src/Delay.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/Hardware/Src/EC11.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/Hardware/Src/oled.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_mcu/src/drv_delay.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_mcu/src/drv_led.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_mcu/src/drv_spi.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_mcu/src/drv_uart.c"
  "f:/cube mx project/JOYTICK/MDK-ARM/drv_periph/src/drv_RF24L01.c"
)

set(AS_FLAGS_f:/cube?mx?project/JOYTICK/MDK-ARM/startup_stm32f103xb.s "-masm=auto")

# Toolchain config map

set(REGISTERED_TOOLCHAIN_ROOT "c:/Users/LENOVO/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.21.0/bin")
set(REGISTERED_TOOLCHAIN_VERSION "6.21.0")
set(TOOLCHAIN_VERSION_MIN "6.21.0")
include ("C:/Users/LENOVO/.vcpkg/artifacts/2139c4c6/tools.open.cmsis.pack.cmsis.toolbox/2.2.1/etc/AC6.6.18.0.cmake")
include ("C:/Users/LENOVO/.vcpkg/artifacts/2139c4c6/tools.open.cmsis.pack.cmsis.toolbox/2.2.1/etc/CMSIS-Build-Utils.cmake")

# Setup project

project(${TARGET} LANGUAGES AS_ARM C)

cbuild_get_running_toolchain(TOOLCHAIN_ROOT TOOLCHAIN_VERSION C)

# Global Flags

set(CMAKE_AS_ARM_FLAGS "${AS_ARM_CPU} ${AS_ARM_BYTE_ORDER} ${AS_ARM_DEFINES} ${AS_ARM_OPTIONS_FLAGS} ${AS_ARM_FLAGS}")
cbuild_get_system_includes(CC_SYS_INC_PATHS_LIST CC_SYS_INC_PATHS)
set(CMAKE_C_FLAGS "${CC_CPU} ${CC_BYTE_ORDER} ${CC_DEFINES} ${CC_OPTIONS_FLAGS} ${CC_FLAGS} ${CC_FLAGS_GLOBAL} ${CC_SYS_INC_PATHS}")
set(CMAKE_C_LINK_FLAGS "${LD_CPU} ${_LS}\"${LD_SCRIPT}\" ${LD_FLAGS_GLOBAL} ${LD_OPTIONS_FLAGS} ${LD_FLAGS}")

# Local Flags

foreach(SRC ${AS_ARM_SRC_FILES})
  string(REPLACE " " "?" S ${SRC})
  if(DEFINED AS_FLAGS_${S})
    set(AS_FLAGS_LOCAL "${AS_FLAGS_${S}}")
  else()
    set(AS_FLAGS_LOCAL "${AS_FLAGS_GLOBAL}")
  endif()
  set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS "${AS_FLAGS_LOCAL}")
  set_source_files_properties(${SRC} PROPERTIES LANGUAGE AS_ARM)
endforeach()

# Compilation Database

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_custom_target(database COMMAND ${CMAKE_COMMAND} -E copy_if_different "${INT_DIR}/compile_commands.json" "${OUT_DIR}")

# Setup Target

add_executable(${TARGET} ${AS_ARM_SRC_FILES} ${CC_SRC_FILES})
set_target_properties(${TARGET} PROPERTIES PREFIX "" SUFFIX ".axf" OUTPUT_NAME "joytick")
set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUT_DIR} LINK_DEPENDS ${LD_SCRIPT})
target_include_directories(${TARGET} PUBLIC ${INC_PATHS})
